import request from './request'

//  获取用户数据
export const userListPageByDeptId = (uri, headers,params) => {
  return request({
    url: uri+'/workflow/api/userListPageByDeptId',
    method: 'get',
    params: params,
    headers: headers
  })
}

//  当前用户数据
export const currentUserDeptTree = (uri, headers, params) => {
  return request({
    url: uri+'/workflow/api/currentUserDeptTree',
    method: 'get',
    params: params,
    headers: headers
  })
}

//  角色数据
export const roleTree = (uri, headers, params) => {
  return request({
    url: uri+'/workflow/api/roleTree',
    method: 'get',
    params: params,
    headers: headers
  })
}

// 获取分类
export const flwProcessType = (uri, headers, params) => {
  return request({
    url: uri+'/web/api/flwProcessType/tree',
    method: 'get',
    params: params,
    headers: headers
  })
}

//  新增/修改修改类型
export const flwProcessTypeSave = (uri, headers, data) => {
  return request({
    url: uri+'/web/api/flwProcessType/save',
    method: 'post',
    data: data,
    headers: headers
  })
}

// 删除类型
export const flwProcessTypeRemove = (uri, headers, params) => {
  return request({
    url: uri+'/web/api/flwProcessType/remove',
    method: 'post',
    params: params,
    headers: headers
  })
}

//  流程列表
export const flwProcessList = (uri, headers, params) => {
  return request({
    url: uri+'/workflow/api/flwProcess/listPage',
    method: 'get',
    params: params,
    headers: headers
  })
}

//  获取流程详情
export const flwProcesInfo = (uri, headers, id) => {
  return request({
    url: uri+'/workflow/api/flwProcess/info/'+id,
    method: 'get',
    headers: headers
  })
}


// 新增/修改流程
export const flwProcessAdd = (uri, headers, data) => {
  return request({
    url: uri+'/web/api/flwProcess/submit',
    method: 'post',
    data: data,
    headers: headers
  })
}

// 删除流程
export const flwProcessRemove = (uri, headers, params) => {
  return request({
    url: uri+'/web/api/flwProcess/remove',
    method: 'post',
    params: params,
    headers: headers
  })
}

// 历史版本
export const historyListPage = (uri, headers, params) => {
  return request({
    url: uri+'/workflow/api/flwProcess/historyListPage',
    method: 'get',
    params: params,
    headers: headers
  })
}

//  获取流程权限
export const flowButtonList = (uri, headers, params) => {
  return request({
    url: uri+'/workflow/api/flowButton/list',
    method: 'get',
    params: params,
    headers: headers
  })
}
//  动态生成 id
export const generateSoleNodeId = (uri, headers, params) => {
  return request({
    url: uri+'/workflow/api/generateSoleNodeId',
    method: 'get',
    params: params,
    headers: headers
  })
}
//  获取流程 json
export const getHisTaskNodeIdByInstanceId = (uri, headers, params) => {
  return request({
    url: uri+'/workflow/api/getHisTaskNodeIdByInstanceId',
    method: 'get',
    params: params,
    headers: headers
  })
}




